package com.highcom.springboot0302.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@EnableWebMvc 全面接管
// 静态资源  视图解析器  欢迎页  全部失效；
//@EnableWebMvc
//@Configuration
public class AdminWebConfig implements WebMvcConfigurer {

    //定义静态资源的行为


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        // http://localhost:8080/static/css/style.css
        registry.addResourceHandler("/static/**")
                .addResourceLocations("classpath:/static/");
    }
}
